export default {
  api: [
    {
      name: 'insert',
      url: '',
      method: 'post'
    },
    {
      name: 'update',
      url: '/user/update',
      method: 'post'
    },
    {
      name: 'delete',
      url: '/user/delete',
      method: 'post'
    },
    {
      name: 'query',
      url: '/user/list',
      method: 'get'
    }
  ],
  fields: [
    {
      prop: 'type',
      label: '类型',
      width: 300,
      props: {
        placeholder: '请选择',
        options: [
          { value: '1', label: '类型1' },
          { value: '2', label: '类型2' }
        ],
        clearable: true
      },
      form: true,
      formType: 'el-select',
      validator: "if(value === 'xxxx') {\n  return true\n}\nreturn 'xxxxxxx不合格'",
      table: true
    },
    {
      prop: 'name',
      label: '标题',
      width: 300,
      filter: true,
      filterProps: {
        type: 'el-input',
        clearable: true
      },
      form: true,
      formType: 'el-input',
      validator: "if(value === 'xxxx') {\n  return true\n}\nreturn 'xxxxxxx不合格'",
      table: true
    },
    {
      prop: 'remark',
      label: '内容',
      table: true,
      form: true,
      formType: 'el-input',
      show: true,
      props: {
        rows: 4,
        type: 'textarea',
        placeholder: '请输入内容xxxxx',
        maxlength: 300,
        showWordLimit: true
      }
    },
    {
      prop: 'creatData',
      width: 200,
      label: '创建时间'
    }
  ],
  pagination: {
    total: 0,
    samll: true,
    pageSize: 50,
    background: true,
    layout: 'total, prev, pager, next, sizes'
  },
  actions: [
    {
      label: '编辑',
      position: '1',
      event: 'onEdit',
      link: true,
      type: 'primary',
      // action: 'console.log("编辑", data)'
      action:
        'this.formData.value = data.row;this.dialog.visible = true;\nthis.dialog.title = "编辑"'
    },
    {
      label: '删除',
      position: '1',
      event: 'onDelete',
      link: true,
      type: 'danger',
      action: 'console.log(this.selection.value)'
    }
  ],
  tableConfig: {
    size: 'small',
    border: true,
    height: 590,
    showIndex: true,
    showSelection: true
  },
  tableOperater: {
    width: 160,
    label: '操作'
  },
  formConfig: {
    labelWidth: '120px',
    style: 'max-width: 500px; margin:auto;padding-right:100px'
  }
};
